package com.kevin.common;

import java.util.HashMap;
import java.util.Map;

public class DwzoutMapUtil {
	/**
	 * 成功状态
	 */
	public static final String SUCCESS = "200";
	public static final String ERROR = "300";
	public static final String TIMEOUT = "301";
	
	/**
	 * 
	  * @方法名  getDwzoutMap 
	  * @功能描述  返回dwz输出的map
	  * @author   吕凯  
	  * @param statusCode
	  * @param message
	  * @param navTabId
	  * @param rel
	  * @param callbackType
	  * @param forwardUrl
	  * @param confirmMsg
	  * @return 
	  * @return  Map<String,Object> 
	  * @编码时间 2012-11-2 下午01:55:34
	 */
	public static Map<String, Object> getDwzoutMap(String statusCode,String message,String navTabId,String rel,String callbackType,String forwardUrl,String confirmMsg){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("statusCode", statusCode);
		map.put("message", (message+"").equals("null")?"操作成功！":message);
		map.put("navTabId", (navTabId+"").equals("null")?"":navTabId);
		map.put("rel", rel);
		map.put("callbackType", callbackType);
		map.put("forwardUrl", forwardUrl);
		map.put("confirmMsg", confirmMsg);
		return map;
	}
	/**
	 * 
	  * @方法名  getSuccDwzoutMap 
	  * @功能描述  返回成功时dwz输出的map
	  * @author   吕凯  
	  * @param message
	  * @param navTabId
	  * @param rel
	  * @param callbackType
	  * @param forwardUrl
	  * @param confirmMsg
	  * @return 
	  * @return  Map<String,Object> 
	  * @编码时间 2012-11-2 下午01:57:15
	 */
	public static Map<String, Object> getSuccDwzoutMap(String message,String navTabId,String rel,String callbackType,String forwardUrl,String confirmMsg){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("statusCode", SUCCESS);
		map.put("message", (message+"").equals("null")?"操作成功！":message);
		map.put("navTabId", (navTabId+"").equals("null")?"":navTabId);
		map.put("rel", rel);
		map.put("callbackType", callbackType);
		map.put("forwardUrl", forwardUrl);
		map.put("confirmMsg", confirmMsg);
		return map;
	}
	/**
	 * 
	  * @方法名  getSuccDwzoutMap 
	  * @功能描述  返回成功时关闭当前窗口dwz输出的map
	  * @author   吕凯  
	  * @param message
	  * @param navTabId
	  * @param rel
	  * @param callbackType
	  * @param forwardUrl
	  * @param confirmMsg
	  * @return 
	  * @return  Map<String,Object> 
	  * @编码时间 2012-11-2 下午01:57:15
	 */
	public static Map<String, Object> getSuccCloseDwzoutMap(String message){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("statusCode", SUCCESS);
		map.put("message", (message+"").equals("null")?"操作成功！":message);
		map.put("navTabId", "");
		map.put("rel", "");
		map.put("callbackType", "closeCurrent");
		map.put("forwardUrl", "");
		map.put("confirmMsg", "");
		return map;
	}
	/**
	 * 
	  * @方法名  getSuccDwzoutMap 
	  * @功能描述  返回成功时dwz输出的map
	  * @author   吕凯  
	  * @param message
	  * @param navTabId
	  * @param rel
	  * @param callbackType
	  * @param forwardUrl
	  * @param confirmMsg
	  * @return 
	  * @return  Map<String,Object> 
	  * @编码时间 2012-11-2 下午01:57:15
	 */
	public static Map<String, Object> getSuccDwzoutMap(String message){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("statusCode", SUCCESS);
		map.put("message", (message+"").equals("null")?"操作成功！":message);
		map.put("navTabId", "");
		map.put("rel", "");
		map.put("callbackType", "");
		map.put("forwardUrl", "");
		map.put("confirmMsg", "");
		return map;
	}
	/**
	 * 
	  * @方法名  getSuccDwzoutMap 
	  * @功能描述  返回操作失败时dwz输出的map
	  * @author   吕凯  
	  * @param message
	  * @param navTabId
	  * @param rel
	  * @param callbackType
	  * @param forwardUrl
	  * @param confirmMsg
	  * @return 
	  * @return  Map<String,Object> 
	  * @编码时间 2012-11-2 下午01:57:15
	 */
	public static Map<String, Object> getErrDwzoutMap(String message){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("statusCode", ERROR);
		map.put("message", (message+"").equals("null")?"操作失败":message);
		return map;
	}
	/**
	 * 
	  * @方法名  getSuccDwzoutMap 
	  * @功能描述  返回会话超时时dwz输出的map
	  * @author   吕凯  
	  * @param message
	  * @param navTabId
	  * @param rel
	  * @param callbackType
	  * @param forwardUrl
	  * @param confirmMsg
	  * @return 
	  * @return  Map<String,Object> 
	  * @编码时间 2012-11-2 下午01:57:15
	 */
	public static Map<String, Object> getTimeOutDwzoutMap(String message){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("statusCode", TIMEOUT);
		map.put("message", (message+"").equals("null")?"会话超时":message);
		return map;
	}

}
